#include "stdafx.h"
#include "Infor.h"

CInfor sInfor;
void CInfor::Print(const TCHAR* szFormat, ...)
{
	TCHAR szDest[256] ={0};
	va_list args;
	va_start(args, szFormat);	
	vswprintf(szDest, 256, szFormat, args);
	va_end(args);
	if (m_strMsg.size()>1000)
	{
		m_strMsg = m_strMsg.substr(m_strMsg.size()-1000,1000);
	}
	m_strMsg = m_strMsg+szDest+_T("\r\n");
	if(m_hWnd != NULL)
		SendMessage(m_hWnd, WM_SETTEXT, 0, (LPARAM)m_strMsg.c_str());
}
void CInfor::SetWnd(HWND hWnd)
{
	m_hWnd = hWnd;
}